@import "partials/variables";

// Page settings
@page {
  size: A4;
  // Marges minimum pour A4
  // margin: 10mm 10mm 15mm 10mm;
}

body {
  padding: 0;
  margin: 0;
}

.container {
  width: auto;
  margin-bottom: 16px;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.container-fluid {
  padding: 0;
}

header#print-header {
  #print-logo {
    height: 1cm;
    width: auto;
  }
}

footer#print-footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  margin: 0;
}

h1 {
  margin-top: 10px;
  margin-bottom: 10px;
  font-size: 30px;
  text-align: center;
  & > small {
    // Ajoute un saut de ligne entre les deux
    &:before {
      content: " ";
      display: block;
    }
  }
}

/* No underscores */
a,
a:visited {
  text-decoration: none;
}

/* We want no link hrefs */
a[href]:after {
  content: "";
}
/* And no attr afters in the calendar either */
.dvqualifs-calendar {
  abbr[title]:after {
    content: "";
  }
}

/* Reduce margins */
table.table:not(.dvqualifs-calendar):not(.invoice-table) {
  margin: 0;
  & > tbody,
  & > tfoot,
  & > thead {
    & > tr {
      & > td,
      & > th {
        border: 1px solid $dv-beige;
        padding: 6px;
      }
    }
  }
}

$letter-address-margin-top: (55mm - 10mm); // 55mm from the top
$letter-address-margin-right: (12mm - 10mm); // 12mm from the right
$letter-address-margin-left: (100mm - 10mm); // 10cm from the left

$letter-logo-size: 3cm;

// Spécifiquement pour la facture
body.dv-invoice {
  header#print-header {
    line-height: 0;
    #print-logo {
      position: absolute;
      height: $letter-logo-size;
      float: left;
    }
  }
  .invoice-address-from {
    margin-left: $letter-logo-size;
  }
  .invoice-address-to {
    // Approximately what makes the address fit in a single-folded A4 sheet towards a window C5 letter
    margin-top: $letter-address-margin-top;
    max-width: calc(100% - #{$letter-address-margin-left + $letter-address-margin-right});
    margin-right: $letter-address-margin-right; // 10mm is the standard right page margin
    font-size: 10pt;
  }
}
